import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:graduation_project/cartoon_module/cartoon_list_double.dart';
import 'package:graduation_project/cartoon_module/cartoon_list_double_view.dart';

class leader_hot extends StatefulWidget {
  const leader_hot({Key key}) : super(key: key);

  @override
  State<leader_hot> createState() => _leader_hotState();
}

class _leader_hotState extends State<leader_hot> {
  List cartoon_list1 = [
    {
      'cartoon': 0,
      'imageUrl': 'http://www.itying.com/images/flutter/1.png',
      'name': '姓名',
      'author': '作者',
      'tage': '标签',
      'stae': '状态'
    },
    {
      'cartoon': 0,
      'imageUrl': 'http://www.itying.com/images/flutter/1.png',
      'name': '姓名',
      'author': '作者',
      'tage': '标签',
      'stae': '状态'
    },
    {
      'cartoon': 0,
      'imageUrl': 'http://www.itying.com/images/flutter/1.png',
      'name': '姓名',
      'author': '作者',
      'tage': '标签',
      'stae': '状态'
    },
    {
      'cartoon': 0,
      'imageUrl': 'http://www.itying.com/images/flutter/1.png',
      'name': '姓名',
      'author': '作者',
      'tage': '标签',
      'stae': '状态'
    },
    {
      'cartoon': 0,
      'imageUrl': 'http://www.itying.com/images/flutter/1.png',
      'name': '姓名',
      'author': '作者',
      'tage': '标签',
      'stae': '状态'
    },
    {
      'cartoon': 0,
      'imageUrl': 'http://www.itying.com/images/flutter/1.png',
      'name': '姓名',
      'author': '作者',
      'tage': '标签',
      'stae': '状态'
    },
  ];
  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      initialIndex: 0,
      length: 5,
      child: Scaffold(
        appBar: PreferredSize(
          preferredSize: Size.fromHeight(100),
          child: AppBar(
            iconTheme: IconThemeData(color: Colors.black),
            centerTitle: true,
            title: Text(
              '热门频道',
              style: TextStyle(color: Colors.black87),
            ),
            // titleTextStyle: TextStyle(color: Colors.black87),
            backgroundColor: Color.fromRGBO(255, 250, 250, 1),
            flexibleSpace: Row(
              children: <Widget>[
                Expanded(
                  child: Container(
                    margin: EdgeInsets.only(top: 75),
                    child: TabBar(
                        indicatorColor: Colors.blue[300],
                        indicatorWeight: 2,
                        indicatorSize: TabBarIndicatorSize.label,
                        labelColor: Colors.black87,
                        unselectedLabelColor: Colors.black54,
                        labelStyle: TextStyle(fontSize: 16),
                        unselectedLabelStyle: TextStyle(fontSize: 14),
                        // controller: _controller,
                        tabs: <Tab>[
                          Tab(text: "热血"),
                          Tab(text: "古风"),
                          Tab(text: "奇幻"),
                          Tab(text: "现代"),
                          Tab(text: "穿越"),

                          // Tab(text: "热番原作"),
                        ]),
                  ),
                )
              ],
            ),
          ),
        ),
        body: TabBarView(
          children: <Widget>[
            cartoon_list_double_view(tage_id: 1),
            cartoon_list_double_view(tage_id: 2),
            cartoon_list_double_view(tage_id: 3),
            cartoon_list_double_view(tage_id: 4),
            cartoon_list_double_view(tage_id: 5),
          ],
        ),
      ),
    );
  }
}
